
#ifndef __PUBLIC_FILELIST_H_
#define __PUBLIC_FILELIST_H_


#include "debug.h"
#include "include_com.h"
#include "include_other.h"


//*******************************************************************************************

typedef enum _public_file_type_e
{
    FILE_TYPE_UNKNOWN = 0, 

	FILE_TYPE_VIDEO   ,
	
	FILE_TYPE_PHOTO   ,

	FILE_TYPE_MUSIC   ,

	FILE_TYPE_VIDEO_PHOTO,

	FILE_TYPE_DIR     ,

    

}public_file_type_e;


typedef struct _media_t
{
	char fileName[512];
	int  filetype;	
	int  is_support;	
}media_t;


typedef struct 
{
	int32_t f_total;
	int32_t f_t_num;
	int32_t f_file_type;
	
	int32_t    f_search_flag;

	char       f_dir[256];
	char       f_save_path[1024];

	cJSON *    f_cRoot;
	cJSON *    f_cMedia;

	pthread_t  f_task_hand;
	
}filelist_para_t;
//*******************************************************************************************


//*******************************************************************************************

int filelist_write_json(cJSON *c_root, const char *filename);

int filelist_get_filename(filelist_para_t * f_para,char * filename,int index);

int filelist_cjson_destory(filelist_para_t * f_para);

filelist_para_t * filelist_cjson_create(const char * dir,int file_type,char * filepath);

#endif
